@import '@moohng/tui/lib/style/index.css';

body {
  margin: 0;
  overflow: hidden;

  --primaryColor: #00CCFF;
}

canvas {
  position: absolute;
}

ul {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

/* 操作栏 */

.toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
}

.toolbar .button {
  margin-left: 8px;
  padding: 6px 8px;
  color: var(--primaryColor);
  border: 1px solid;
  border-radius: 100px;
}

.toolbar .button .iconfont {
  font-size: 20px;
}

/* 颜色选择 */

.color-bar,
.width-bar {
  padding: 8px 0;
  position: fixed;
  top: 45%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  background-color: #efefef;
  border-radius: 100px;
}

.color-bar {
  right: 16px;
}

.width-bar {
  left: 16px;
}

.color-bar .button,
.width-bar .button {
  position: relative;
  margin: 8px 0;
  width: 44px;
  text-align: center;
}

.button input[type="radio"],
.button input[type="color"] {
  display: block;
  margin: 0;
  width: 100%;
  height: 22px;
  opacity: 0;
}

.button input[type="radio"] + .icon,
.button input[type="color"] + .icon {
  padding: 4px;
  position: absolute;
  top: 0;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  background-color: currentColor;
  background-clip: content-box;
  z-index: -1;
  pointer-events: none;
}

.button input[type="radio"] + .icon {
  border-radius: 16px;
}

.button input[type="radio"]:checked + .icon,
.color-bar .button input[type="radio"]:checked + .icon {
  box-shadow: 0 0 8px var(--primaryColor);
}

.color-bar .button input[type="radio"] + .icon {
  box-shadow: 0 0 1px currentColor;
}

.width-bar .button input[type="radio"]::after {
  width: inherit;
  height: inherit;
}

.line {
  margin: 4px 8px;
  border-bottom: 1px solid #ddd;
}

/* 预览控制 */

.preview-cover {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s;
  background-color: rgba(44, 44, 44, .4);
  z-index: 0;
}

.preview-cover .icon-play {
  color: #fff;
  font-size: 44px;
  cursor: pointer;
}

.preview-cover .bottom {
  position: absolute;
  bottom: 40px;
}

.preview-cover .bottom .btn {
  display: block;
  margin: 16px 0;
  padding: 8px 16px;
  color: #666;
  text-align: center;
  background-color: #fff;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

.preview-cover .bottom .btn:first-child {
  color: var(--primaryColor);
}

/* 弹窗 */

.tui-dialog input[name="code"] {
  padding: 8px 12px;
  border: 1px solid #999;
  border-radius: 6px;
}

.tui-dialog input[name="code"]:focus {
  border-color: var(--primaryColor);
  outline: none;
}

.tui-dialog .btn {
  color: #333;
  letter-spacing: 2px;
  text-decoration: none;
}
